package com.qf.stub;

import com.qf.pojo.Order;
import com.qf.service.OrderService;

import java.util.List;

public class OrderServiceStub implements OrderService {

    //就是那个远程调用代理对象
    private OrderService orderService;

    public OrderServiceStub(OrderService orderService) {
        this.orderService = orderService;
    }

    @Override
    public List<Order> findByUid(Integer uid) throws InterruptedException {

        if (uid > 100){
            throw  new RuntimeException("uid:"+uid+"不存在");
        }

        //发起远程调用
        return orderService.findByUid(uid);
    }
}
